//
//  TanChuCollectionReusableView.m
//  ZhiBoYuan
//
//  Created by coder_di on 2018/5/7.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "TanChuCollectionReusableView.h"

@implementation TanChuCollectionReusableView

-(void)setDataDic:(NSDictionary *)dataDic{
    _dataDic = dataDic;
    [self.imageVC sd_setImageWithURL:[NSURL URLWithString:[_dataDic[@"student_info"] valueForKey:@"small_img"]] placeholderImage:[UIImage imageNamed:@"0009"]];
     [self addSubview:_imageVC];
    
    self.nameLable.text = [_dataDic[@"student_info"] valueForKey:@"name"];
    [self addSubview:_nameLable];
    
    self.zuotiLable.text = [NSString stringWithFormat:@"做题时间：%@",[_dataDic valueForKey:@"do_use_time"]];
     [self addSubview:_zuotiLable];
    
    self.startLable.text = [NSString stringWithFormat:@"开始做题时间：%@",[_dataDic valueForKey:@"start_do_question_time"]];
    [self addSubview:_startLable];
    
    self.jiaojuanLable.text = [NSString stringWithFormat:@"交卷时间：%@",[_dataDic valueForKey:@"end_do_question_time"]];
    [self addSubview:_jiaojuanLable];
    
}

- (id)initWithFrame:(CGRect)frame

{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        _imageVC = [[UIImageView alloc]initWithFrame:CGRectMake(10 * KscreenWidth, 10 * KscreenHeight, 50 * KscreenWidth, 50 * KscreenHeight)];
        _imageVC.backgroundColor = [UIColor grayColor];
        _imageVC.layer.masksToBounds = YES;
        _imageVC.layer.cornerRadius = 25 * KscreenWidth;
//        [self addSubview:_imageVC];
        
        _nameLable = [[UILabel alloc]initWithFrame:CGRectMake(70 * KscreenWidth, 10 * KscreenHeight, 100 * KscreenWidth, 25 * KscreenHeight)];
        _nameLable.font = [UIFont systemFontOfSize:18 * KscreenWidth];
        _nameLable.text = @"张三";
//        [self addSubview:_nameLable];
        
        _zuotiLable = [[UILabel alloc]initWithFrame:CGRectMake(70 * KscreenWidth, 35 * KscreenHeight, 200 * KscreenWidth, 25 * KscreenHeight)];
        _zuotiLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
        _zuotiLable.text = @"做题时间：2分48秒";
//        [self addSubview:_zuotiLable];
        
        UIView *line1 = [[UIView alloc]initWithFrame:CGRectMake(0, 70 * KscreenHeight, self.width, 1 * KscreenHeight)];
        line1.backgroundColor = hui1Color;
        [self addSubview:line1];
        
//        _shipinTimeLable = [[UILabel alloc]initWithFrame:CGRectMake(10 * KscreenWidth, 80 * KscreenHeight, 250 * KscreenWidth, 20 * KscreenHeight)];
//        _shipinTimeLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
//        _shipinTimeLable.textColor = hui5Color;
//        _shipinTimeLable.text = @"看视频时间：2018-09-01 20:30:00";
//        [self addSubview:_shipinTimeLable];
        
        _startLable = [[UILabel alloc]initWithFrame:CGRectMake(10 * KscreenWidth, 80 * KscreenHeight, 270 * KscreenWidth, 20 * KscreenHeight)];
        _startLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
        _startLable.textColor = hui5Color;
        _startLable.text = @"开始做题时间：2018-09-01 20:30:00";
//        [self addSubview:_startLable];
        
        _jiaojuanLable = [[UILabel alloc]initWithFrame:CGRectMake(10 * KscreenWidth, 100 * KscreenHeight, 250 * KscreenWidth, 20 * KscreenHeight)];
        _jiaojuanLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
        _jiaojuanLable.textColor = hui5Color;
        _jiaojuanLable.text = @"交卷时间：2018-09-01 20:30:00";
//        [self addSubview:_jiaojuanLable];
        
        UIView *line2 = [[UIView alloc]initWithFrame:CGRectMake(0, 130 * KscreenHeight, self.width, 1 * KscreenHeight)];
        line2.backgroundColor = hui1Color;
        [self addSubview:line2];
        
        UIImageView *imagevv = [[UIImageView alloc]initWithFrame:CGRectMake(screenWidth - 210 * KscreenWidth, 140 * KscreenHeight, 140 * KscreenWidth, 30 * KscreenHeight)];
        imagevv.image = [UIImage imageNamed:@"统计详情"];
        [self addSubview:imagevv];
    }
    
    return self;
    
}
@end
